﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  targetNamespace="http://www.codeplex.com/MSSqlSchemaDoc"
  xmlns="http://www.codeplex.com/MSSqlSchemaDoc"
  attributeFormDefault="unqualified"
  elementFormDefault="qualified">
  
  <xs:element name="StoredProcedure">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Parameters">
          <xs:complexType>
            <xs:sequence>
              <xs:element minOccurs="0" maxOccurs="unbounded" name="ProcedureParameter">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="IsOutputParameter" type="xs:boolean" />
                    <xs:element name="IsCursorReference" type="xs:boolean" />
                    <xs:element name="IsCompleteXmlDocument" type="xs:boolean" />
                    <xs:element name="HasDefaultValue" type="xs:boolean" />
                    <xs:element name="XmlCollectionId" type="xs:unsignedByte" />
                    <xs:element name="DataType">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="MaxLength" type="xs:integer" />
                          <xs:element name="Precision" type="xs:unsignedByte" />
                          <xs:element name="Scale" type="xs:unsignedByte" />
                        </xs:sequence>
                        <xs:attribute name="Name" type="xs:string" use="required" />
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                  <xs:attribute name="Name" type="xs:string" use="required" />
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="IsAutoExecuted" type="xs:boolean" />
        <xs:element name="IsExecutionReplicated" type="xs:boolean" />
        <xs:element name="IsReplicationSerializableOnly" type="xs:boolean" />
        <xs:element name="SkipsReplicationConstraints" type="xs:boolean" />
        <xs:element name="UsesAnsiNulls" type="xs:boolean" />
        <xs:element name="UsesQuotedIdentifier" type="xs:boolean" />
        <xs:element name="IsSchemaBound" type="xs:boolean" />
        <xs:element name="UsesDatabaseCollation" type="xs:boolean" />
        <xs:element name="IsRecompiled" type="xs:boolean" />
        <xs:element name="ExecuteAsPrincipalId" type="xs:integer" nillable="true" />
        <xs:element name="Definition" type="xs:string" />
      </xs:sequence>
      <xs:attribute name="Name" type="xs:string" use="required" />
      <xs:attribute name="Schema" type="xs:string" use="required" />
    </xs:complexType>
  </xs:element>

</xs:schema>